<template>
    <el-card style="width: 80px;height:80px; text-align: center;cursor: pointer;" v-for="(item,index) in cardlist"
        @click="handlerClick(index,item)">
        <h2>{{item}}</h2>
    </el-card>
</template>

<script setup lang="ts">
    import {inject } from 'vue'
    import { useStore } from 'vuex'
    import { key } from '../store'
    const store = useStore(key)
    let cardlist = inject('cardlist')
    const handlerClick = (index, num): void => {
        store.commit('handlerModal', { index, num })
    }
</script>

<style scoped>
    .el-card__body {
        cursor: pointer;
    }
</style>